<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var a = 10;
        // let a = 10;
        // console.log(a);//Identifier 'a' has already been declared
        // let 声明变量 
        // console.log(b); //undefined
        // var b = 20;
        // console.log(c); //Cannot access 'c' before initialization
        // let c = 30;
        //let的特点
        //1.let 没有变量提升
        //2.let 声明的变量有块级作用域
        //3.let 存在暂时性死区
        // var d = 10;
        // if(true){
        //     console.log(d);//10
        //     var f = 20;
        //     console.log(f);//20
        // }
        // console.log(d);//10
        //块级作用域{}
        // let d = 10;
        // if(true){
        //     console.log(d);
        //     let f = 20;
        //     console.log(f);
        // }
        // console.log(f);// f is not defined
    </script>
</body>
</html>